<?php

namespace System\Configure\Exception;

/**
 * 解析INI配置文件到数组异常类
 *
 * @package Dream
 * @subpackage ParserIniException
 * @namespace System\Configure\Exception
 * @author lewis (lewisld@yeah.net)
 */
class ParserIniException extends ConfigException
{
    public function __construct(array $error)
    {
        $message = [$error['message'], ['file' => $error['inifile']]];
        $code = isset($error['code']) ? $error['code'] : 0;
        $severity = isset($error['type']) ? $error['type'] : 1;
        $filename = isset($error['file']) ? $error['file'] : __FILE__;
        $lineno = isset($error['line']) ? $error['line'] : __LINE__;
        $previous = isset($error['exception']) ? $error['exception'] : null;

        parent::__construct($message, $code, $severity, $filename, $lineno, $previous);
    }
}